import request from '@/utils/request'

// 查询标的公司-企业填报账号列表
export function listCompanyAccount(query) {
  return request({
    url: '/company/companyAccount/list',
    method: 'get',
    params: query
  })
}

// 查询标的公司-企业填报账号详细
export function getCompanyAccount(id) {
  return request({
    url: '/company/companyAccount/' + id,
    method: 'get'
  })
}

// 保存标的公司-企业填报账号
export function saveCompanyAccount(data) {
  return request({
    url: '/company/companyAccount/save',
    method: 'post',
    data: data
  })
}

// 注销账户
export function delCompanyAccount(id) {
  return request({
    url: '/companyPortal/login/delCompanyAccount/' + id,
    method: 'get'
  })
}

// 校验账号是否存在
export function verifyThatTheAccountExists(userName) {
  return request({
    url: '/companyPortal/login/verifyThatTheAccountExists/' + userName,
    method: 'get'
  })
}

// 根据companyId获取对象
export function getByCompanyId(companyId) {
  return request({
    url: '/companyPortal/login/getByCompanyId/' + companyId,
    method: 'get'
  })
}

// 新增开通用户
export function saveAccountUser(data) {
  return request({
    url: '/companyPortal/login/saveCompanyAccount',
    method: 'post',
    data: data
  })
}
